export function useMyFullscreen() {
  const isFullscreen = ref(false)

  const onresize = () => {
    if (document.fullscreenElement) {
      isFullscreen.value = true
    } else {
      isFullscreen.value = false
    }
  }
  // 监听事件
  window.addEventListener('resize', onresize)

  onUnmounted(() => {
    // 清空所有的事件，避免多组件互相清理
    console.log(2)
  })

  return {
    isFullscreen,
  }
}
